<template>
  <el-dialog
    title="工单详情"
    :visible.sync="visible"
    width="30%"
    :before-close="handleClose"
  >
    <div class="head">
      <div class="icon">
        <i :class="str" />
        <!-- <span>{{ status }}</span> -->
      </div>
      <img :src="img" alt="">
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" style="background-color:#fbf4f0 !important;color:#655b56!important;border:none">重新创建</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { getInfo } from '@/api/table'
export default {
  name: 'DkdElementFindInfo',
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      str: '',
      img: '',
      taskId: ''
    }
  },
  computed: {
    // status() {
    //   return this.form.taskStatusTypeEntity.statusName
    // }
  },
  mounted() {
    this.getInfo()
  },

  methods: {
    handleClose() {
      this.$emit('update:visible', false)
    },
    async getInfo() {
      const res = await getInfo(this.taskId)
      console.log(res)
    }
    // getInfo() {
    //   console.log(this.status)
    //   this.$nextTick(function() {
    //     if (this.form.taskStatusTypeEntity.statusName === '完成') {
    //       this.str = 'el-icon-success'
    //       this.img = 'https://likede2-admin.itheima.net/img/pic_4.3b5af41c.png'
    //     } else if (this.form.taskStatusTypeEntity.statusName === '待办') {
    //       this.str = 'el-icon-success'
    //       this.img = 'https://likede2-admin.itheima.net/img/pic_1.834b274c.png'
    //     } else {
    //       this.str = 'el-icon-warning'
    //       this.img = 'https://likede2-admin.itheima.net/img/pic_3.e8208e34.png'
    //     }
    //   })
    // }
  }
}
</script>

<style lang="scss" scoped>
.head {
  width: 100%;
  height: 60px;
  background-color: hsla(0,0%,92.5%,.39);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  i {
    font-size: 30px;
  }
  .green {
    color: lawngreen;
  }
  span {
    font-size: 16px;
    margin-left: 20px;
  }
}
</style>
